// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 

package com.nnee.p_pr.p_a;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.os.*;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.view.*;
import com.nnee.p_g.cls_b;
import java.lang.reflect.Method;
import java.util.Locale;

// Referenced classes of package com.nnee.p_pr.a:
//            q, o, t, j, 
//            g, k

public class cls_u
{

    public cls_u()
    {
    }

    public static int a(Context context)
    {
        int i1;
        cls_t t1;
        i1 = 0;
        t1 = c(context);
        switch(com.nnee.p_pr.p_a.cls_o.b[t1.ordinal()])
        {
        case 1:
        case 2:
        	i1 = 2;
        	break;
        case 3:
        	i1 = 1;
        	break;
        case 4:
        	i1 = 3;
        	break;
        case 5:
        case 6:
        	default:
        	break;
        }
        return i1;
        
    }

    public static cls_j a(String s)
    {
        cls_j j1;
        if(s == null || s.length() <= 0)
        {
            j1 = cls_j.gEDEFAULT;
        } else
        {
            String s1 = s.toLowerCase();
            if(s1.startsWith(com.nnee.p_pr.p_a.cls_g.b))
                j1 = com.nnee.p_pr.p_a.cls_j.bECMNET;
            else
            if(s1.startsWith(cls_g.a))
                j1 = cls_j.aECMWAP;
            else
            if(s1.startsWith(cls_g.d))
                j1 = cls_j.dE3GNET;
            else
            if(s1.startsWith(cls_g.c))
                j1 = cls_j.cE3GWAP;
            else
            if(s1.startsWith(cls_g.f))
                j1 = cls_j.fEUNINET;
            else
            if(s1.startsWith(cls_g.e))
                j1 = cls_j.eEUNIWAP;
            else
            if(s1.startsWith("default"))
                j1 = cls_j.gEDEFAULT;
            else
                j1 = cls_j.gEDEFAULT;
        }
        return j1;
    }

    public static boolean a()
    {
        boolean flag;
        if("mounted".equals(Environment.getExternalStorageState()))
            flag = true;
        else
            flag = false;
        return flag;
    }

    public static boolean a(String s, long l1)
    {
        boolean flag = true;
        if(!TextUtils.isEmpty(s)) {
        	StatFs statfs = new StatFs(s);
            if((long)statfs.getAvailableBlocks() * (long)statfs.getBlockSize() <= l1)
                flag = false;
        }
        return flag;

    }

    public static String b()
    {
        return Build.MODEL;
    }

    public static boolean b(Context context)
    {
        NetworkInfo networkinfo = ((ConnectivityManager)context.getSystemService("connectivity")).getActiveNetworkInfo();
        boolean flag;
        if(networkinfo == null || networkinfo.getType() != 0)
        {
            flag = false;
        } else
        {
            String s = networkinfo.getExtraInfo();
            if(s == null || s.length() < 3)
                flag = false;
            else
            if(s.toLowerCase().contains("wap"))
                flag = true;
            else
                flag = false;
        }
        return flag;
    }

    static boolean b(String s)
    {
        switch(cls_o.a[a(s).ordinal()])
        {
        case 1: // '\001'
        case 2: // '\002'
        case 3: // '\003'
        case 4: // '\004'
        case 5: // '\005'
        case 6: // '\006'
        case 7: // '\007'
        default:
            return false;
        }
    }

    public static cls_t c(Context context)
    {
    	cls_t t1 =null;
        int i1;
        ConnectivityManager connectivitymanager;
        i1 = 0;
        connectivitymanager = (ConnectivityManager)context.getSystemService("connectivity");
        if(connectivitymanager != null) {
        	NetworkInfo anetworkinfo[];
            int j1;
            anetworkinfo = connectivitymanager.getAllNetworkInfo();
            if(anetworkinfo == null)
                return null;
            j1 = i1;
            
            while (true)
            {
            	if(j1 >= anetworkinfo.length)
                    break; /* Loop/switch isn't completed */
            	
            	if(anetworkinfo[j1] == null || !anetworkinfo[j1].isAvailable() || !anetworkinfo[j1].isConnectedOrConnecting()) {
            		j1++;
            	}else {
            		 if(anetworkinfo[j1].getType() != 1)
            	            continue; /* Loop/switch isn't completed */
            	        t1 = cls_t.eEWirelessWIFI;
            	        
            	        if(anetworkinfo[j1].getType() != 0) {
            	        	j1++;
            	        } else {
            	        	 String s = anetworkinfo[j1].getExtraInfo();
            	             if(s == null || s.length() < 3)
            	                 t1 = cls_t.dEWirelessNET;
            	             else
            	             if(s.toLowerCase().endsWith("wap"))
            	                 t1 = cls_t.cEWirelessWAP;
            	             else
            	                 t1 = cls_t.dEWirelessNET;
            	             
            	        }
            	}
            }
        } else {
        	t1 = cls_t.aEWirelessNULL;
        }
 
        return t1;

    }

    public static boolean c()
    {
        boolean flag = true;
        Method amethod[] = android.view.MotionEvent.class.getDeclaredMethods();
        int i1 = amethod.length;
        int j1 = 0;
        boolean flag1 = false;
        boolean flag2 = false;
        for(; j1 < i1; j1++)
        {
            Method method = amethod[j1];
            if(method.getName().equals("getPointerCount"))
                flag2 = flag;
            if(method.getName().equals("getPointerId"))
                flag1 = flag;
        }

        if(!flag2 || !flag1)
            flag = false;
        return flag;
    }

    public static boolean e(Context context)
    {
        boolean flag;
        ConnectivityManager connectivitymanager;
        flag = false;
        connectivitymanager = (ConnectivityManager)context.getSystemService("connectivity");
        if(connectivitymanager != null) {
        	 NetworkInfo anetworkinfo[];
             int i1;
             anetworkinfo = connectivitymanager.getAllNetworkInfo();
             if(anetworkinfo == null)
            	 return false;
             i1 = ((flag) ? 1 : 0);
             
             while(true)
             {
            	 if(i1 < anetworkinfo.length)
                 {
         
                     {
                         if(anetworkinfo[i1] == null || !anetworkinfo[i1].isAvailable() || !anetworkinfo[i1].isConnectedOrConnecting())
                         {
                        	 i1++;
                        	 continue;
                         }
                         else
                         {
                         flag = true;
                         return flag;
                         }
                     }
                 }
            	 else
                 {
            		 return flag;
                 }
         
                
             }
        }
 
        return flag;
 
    }

    public static String f(Context context)
    {
        return ((TelephonyManager)context.getSystemService("phone")).getSubscriberId();
    }

    public static String g(Context context)
    {
        String s = null;
        String s2 = h(context);
        String s1 = s2;
        String s3;
        if(!TextUtils.isEmpty(s1))
           return null;
        s3 = i(context);
        s1 = s3;

        if(s1 == null)
            s1 = "";
        return s1;
    }

    public static String h(Context context)
    {
        return ((TelephonyManager)context.getSystemService("phone")).getDeviceId();
    }

    public static String i(Context context)
    {
        return ((WifiManager)context.getSystemService("wifi")).getConnectionInfo().getMacAddress();
    }

    public static String j(Context context)
    {
        return ((TelephonyManager)context.getSystemService("phone")).getLine1Number();
    }

    public static float k(Context context)
    {
        DisplayMetrics displaymetrics = new DisplayMetrics();
        ((WindowManager)context.getSystemService("window")).getDefaultDisplay().getMetrics(displaymetrics);
        return displaymetrics.density;
    }

    public static int[] l(Context context)
    {
        DisplayMetrics displaymetrics = new DisplayMetrics();
        ((WindowManager)context.getSystemService("window")).getDefaultDisplay().getMetrics(displaymetrics);
        int k1;
        int l1;
        int ai[];
        if(com.nnee.p_pr.p_a.cls_q.a() >= 5)
        {
            int i2 = displaymetrics.widthPixels;
            int j2 = displaymetrics.heightPixels;
            k1 = i2;
            l1 = j2;
        } else
        {
            int i1 = (int)((float)displaymetrics.widthPixels / displaymetrics.density);
            int j1 = (int)((float)displaymetrics.heightPixels / displaymetrics.density);
            k1 = i1;
            l1 = j1;
        }
        if(k1 > l1)
        {
            ai = new int[2];
            ai[0] = l1;
            ai[1] = k1;
        } else
        {
            ai = new int[2];
            ai[0] = k1;
            ai[1] = l1;
        }
        return ai;
    }

    public static String m(Context context)
    {
        int ai[] = l(context);
        return (new StringBuilder()).append(ai[0]).append("/").append(ai[1]).toString();
    }

    public static int n(Context context)
    {
        DisplayMetrics displaymetrics = new DisplayMetrics();
        ((WindowManager)context.getSystemService("window")).getDefaultDisplay().getMetrics(displaymetrics);
        return displaymetrics.widthPixels;
    }

    public static int o(Context context)
    {
        DisplayMetrics displaymetrics = new DisplayMetrics();
        ((WindowManager)context.getSystemService("window")).getDefaultDisplay().getMetrics(displaymetrics);
        return displaymetrics.heightPixels;
    }

    public static int p(Context context)
    {
        DisplayMetrics displaymetrics = new DisplayMetrics();
        ((WindowManager)context.getSystemService("window")).getDefaultDisplay().getMetrics(displaymetrics);
        return (int)(0.5F + (float)displaymetrics.widthPixels * displaymetrics.density);
    }

    public static int q(Context context)
    {
        DisplayMetrics displaymetrics = new DisplayMetrics();
        ((WindowManager)context.getSystemService("window")).getDefaultDisplay().getMetrics(displaymetrics);
        return (int)(0.5F + (float)displaymetrics.heightPixels * displaymetrics.density);
    }

    public static String r(Context context)
    {
        Locale locale = Locale.getDefault();
        return (new StringBuilder()).append(locale.getLanguage()).append("-").append(locale.getCountry()).toString();
    }

    public cls_k d(Context context)
    {
        cls_k k1 = cls_k.kENET_UNKNOW;
        int i1 = ((TelephonyManager)context.getSystemService("phone")).getNetworkType();
        cls_k k2;
        if(c == i1)
            k2 = cls_k.aENET_CDMA;
        else
        if(d == i1)
            k2 = com.nnee.p_pr.p_a.cls_k.bENET_EDGE;
        else
        if(e == i1)
            k2 = cls_k.cENET_EVDO_R0;
        else
        if(f == i1)
            k2 = cls_k.dENET_EVDO_RA;
        else
        if(g == i1)
            k2 = cls_k.fENET_GPRS;
        else
        if(h == i1)
            k2 = cls_k.gENET_HSDPA;
        else
        if(i == i1)
            k2 = cls_k.hENET_HSPA;
        else
        if(j == i1)
            k2 = cls_k.iENET_HSUPA;
        else
        if(k == i1)
            k2 = cls_k.jENET_UMTS;
        else
            k2 = k1;
        return k2;
    }

    static final String a = "PhoneUtil";
    static int b;
    static int c;
    static int d;
    static int e;
    static int f;
    static int g;
    static int h;
    static int i;
    static int j;
    static int k;
    static int l;
    static int m = 12;
    static int n = 11;

    static 
    {
        b = -1;
        c = -2;
        d = 2;
        e = -4;
        f = -5;
        g = 1;
        h = -7;
        i = -8;
        j = -9;
        k = 3;
        l = 0;
        m = -12;
        n = -13;
       switch( com.nnee.p_pr.p_a.cls_q.a())
       {
       case 4:
    	   b = 7;
           f = 6;
           e = 5;
           c = 4;
    	   break;
       case 5:
       case 6:
       case 7:
    	   
       case 8:
    	   
       case 9:
    	   
    	   i = 10;
           j = 9;
           h = 8;
    	   break;
       default:
    	   break;
       }
       
    }
}
